<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JS数据类型</title>
</head>
<body>
//JS数据类型
//原始类型 string number boolean undefined null
//引用类型 Object Number Boolean Function Array
<script>
    var a = 10;
    var b = 6.6;
    var c = '你好';
    var d = "你好呀";
    var f = false;
    console.log(a,typeof a);
    var e = true;
    console.log(e,typeof e);
    console.log(f,typeof f);
    //声明了变量，但未赋值，会得到undefined，未定义型
    var g;
    console.log(g,typeof g);//undefined

    //引用类型 Object Number Boolean Function Array
    //1）定义JS对象
    let obj = {
        name:'张三',
        age:18
    }
    console.log(obj,typeof obj);
    console.log(obj.name);
    console.log(obj.age);
    obj.age = 19;//属性存在，赋值是修改对象该属性的值
    console.log(obj.age);//19

    obj.like = '打篮球';//like属性不存在，赋值是个对象新增一个属性
    console.log(obj.like);
    console.log(obj.play);//undefined


    let arr = ['李逵','李逵','李逵',1,1.6,true]
    console.log(arr,typeof arr)
    console.log(arr[0])
    console.log(arr[5])
    console.log(arr[99])//undefined
























</script>
</body>
</html>